import Login from '../pages/Login'
import Register from '../pages/Register'
import Home from '../pages/Home'
import NotFind from '../pages/NotFind'
import Main from '../pages/subs/Main'
import User from '../pages/subs/User'
import Role from '../pages/subs/Role'
import ProductList from '../pages/subs/ProductList'
import Category from '../pages/subs/Category'
import ProductAdd from '../pages/subs/ProductAdd'
import ProductUpdate from "../pages/subs/ProductUpdate"
import RouterAuth from './RouterAuth'
import Salary from "../pages/subs/Salary"
import Sale from '../pages/subs/Sale'

const routes = [
    {
        index:true,
        element:<Login></Login>
    },
    {
        path:"/register",
        element:<Register></Register>
    },
    {
        path:"/home",
        element: <RouterAuth>
                    <Home></Home>
                </RouterAuth> ,
        children:[
            {
                index:true,
                element:<Main></Main>
            },
            {
                path:"user",
                element:<User></User>
            },
            {
                path:"role",
                element:<Role></Role>
            },
            {
                path:"list",
                element:<ProductList></ProductList>
            },
            {
                path:"category",
                element:<Category></Category>
            },
            {
                path:"productAdd",
                element:<ProductAdd></ProductAdd>
            },
            {
                path:"productUpdate",
                element:<ProductUpdate></ProductUpdate>
            },
            {
                path:"salary",
                element:<Salary></Salary>
            },
            {
                path:"sale",
                element:<Sale></Sale>
            }
        ]
    },
    {
        path:"*",
        element:<NotFind></NotFind>
    }
]

export default routes